package com.spring.applicationEven_annotation_demo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * AnnotationConfigApplicationContext 不需要xml!!!
 */
public class App {
	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
//		String[] beanDefinitionNames = context.getBeanDefinitionNames();
//		for (String beanDefinitionName : beanDefinitionNames) {
//			System.out.println(beanDefinitionName);
//		}
		EmailService emailService = (EmailService) context.getBean("emailService");
		emailService.sendEmail("addre1","hello~");
		emailService.sendEmail("qqq@qq.com","hello~");
		System.out.println("heiheihei ");
	}
}
